<template>
    <div>
        <el-tag :size="propJson.size" :effect="propJson.effect" :type="propJson.type"
            :closable="propJson.isClosable" :round="propJson.isRound" :tempInfo="tagContent">
            {{responseInfo}}
        </el-tag>
    </div>
</template>


<script setup lang="ts" name="TagComponent">
import {computed, defineProps, ref} from "vue";
import {doThirdServiceValue} from "@/utils/lowcode/thirdService.ts";

let props = defineProps(['propJson', 'commonParam']);

let propJson = computed(() => {return props['propJson']})
let commonParam = computed(() => {return props['commonParam']})

let responseInfo = ref("")

let tagContent = computed(() => {
    doResponse();
})

function execThen(resValue) {
    if (!resValue && propJson.value.editFlag) {
        responseInfo.value = "暂无数据"
    } else {
        responseInfo.value = resValue
    }
}

async function doResponse() {
    await doThirdServiceValue(propJson.value.tagContentInfo, commonParam.value, execThen, () => {}, null)
}
</script>


<style scoped lang="less">

</style>